package com.ces.knacky.model;

import java.io.Serializable;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractTenantEntity;

/** @author Hibernate CodeGenerator */
public class Category extends AbstractTenantEntity implements Serializable {

    /** persistent field */
    private com.ces.knacky.model.Category parent;
    /** persistent field */
    private Set categories;

    /** persistent field */
    private Set itemCategories;

    /** persistent field */
    private Set companyCategories;

    /** full constructor */
    public Category(String description, Category parent, com.ces.knacky.model.Flag flag, Set categories, Set itemCategories, Set companyCategories) {
        this.description = description;
        this.parent = parent;
        this.flag = flag;
        this.categories = categories;
        this.itemCategories = itemCategories;
        this.companyCategories = companyCategories;
    }

    /** default constructor */
    public Category() {
    }


    public Category getparent() {
        return this.parent;
    }

    public void setparent(Category parent) {
        this.parent = parent;
    }

    public Set getCategories() {
        return this.categories;
    }

    public void setCategories(Set categories) {
        this.categories = categories;
    }
    public Set getItemCategories() {
        return this.itemCategories;
    }

    public void setItemCategories(Set itemCategories) {
        this.itemCategories = itemCategories;
    }

    public Set getCompanyCategories() {
        return this.companyCategories;
    }

    public void setCompanyCategories(Set companyCategories) {
        this.companyCategories = companyCategories;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof Category) ) return false;
        Category castOther = (Category) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }

}
